package com.wuyb.controller;

import com.wuyb.pojo.entity.BaseResponse;
import com.wuyb.service.AdminLogService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import jakarta.annotation.Resource;
import lombok.extern.slf4j.Slf4j;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;

import java.util.Map;

/**
 * Admin控制器
 *
 * @Author: wyb
 * @Date: 2024/01/08/17:37
 * @Description:
 */
@Slf4j
@Api(tags = "管理员操作日志")
@RestController
@RequestMapping("/adminLog")
public class AdminLogController {


    @Resource
    private AdminLogService adminLogService;


    @PreAuthorize("@SGExpressionRoot.hasAuthority('adminLog')")
    @ApiOperation("分页查看操作日志列表")
    @GetMapping("/{current}/{size}")
    private BaseResponse<?> select(@PathVariable Integer current, @PathVariable Integer size, @RequestParam Map<String, String> params) {
        log.info(String.format("get:/adminLog 分页查看操作日志列表。%d , %d", current, size));
        return adminLogService.select(current, size, params);
    }
}
